# Maintainer:

pkgname=python-hatch-nodejs-version
pkgver=0.3.1
pkgrel=3
pkgdesc='Hatch plugin for versioning from a package.json file'
arch=(any)
url='https://github.com/agoose77/hatch-nodejs-version'
license=(MIT)
depends=(python-hatchling)
makedepends=(python-build python-installer)
checkdepends=(python-pytest)
source=(https://github.com/agoose77/hatch-nodejs-version/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('9959efbee3021dba4da7f8c152cacf104c746341ed176cd0488cbf3b45deba4d')

build() {
  cd hatch-nodejs-version-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd hatch-nodejs-version-$pkgver
  PYTHONPATH="$PWD"/src \
  pytest -v
}

package() {
  cd hatch-nodejs-version-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
